#include "Projectile.h"

Projectile::Projectile(const sf::Vector2f& position, const sf::Vector2f& speed, int imageId)
: Entity(position, AnimatedSpritePtr(new AnimatedSprite(imageId))) // temp until we get ProjectileData
, speed(speed)
{
}

void Projectile::setSpeed(const sf::Vector2f speed)
{
	this->speed = speed;
}

sf::Vector2f Projectile::getSpeed() const
{
	return speed;
}

void Projectile::update(float delta)
{
    setPosition(getPosition()+speed*delta);
    getSprite()->SetPosition(getPosition()); 
}